<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServiceMemberView.aspx.cs"
    Inherits="Liberty.UI.Service.ServiceMemberManagement.ServiceMemberView" MasterPageFile="~/Main.master"
    Title="Service Member" %>

<%@ Register Assembly="Liberty.Controls" Namespace="Liberty.Controls.WebControls"
    TagPrefix="cc1" %>

<%@ Register Src="../CaseManagement/Controls/CaseSummaryView.ascx" TagName="CaseSummaryView"
    TagPrefix="uc5" %>
<%@ Register Src="../GrantManagement/Controls/GrantSummaryView.ascx" TagName="GrantSummaryView"
    TagPrefix="uc6" %>

<%@ Register Src="Controls/ServiceMemberDetailView.ascx" TagName="ServiceMemberDetailView"
    TagPrefix="uc1" %>
<%@ Register Src="Controls/ServiceMemberEditView.ascx" TagName="ServiceMemberEditView"
    TagPrefix="uc2" %>
<%@ Register Src="../NoteManagement/Controls/NewNoteView.ascx" TagName="NewNoteView"
    TagPrefix="uc3" %>
<%@ Register Src="../NoteManagement/Controls/NoteListView.ascx" TagName="NoteListView"
    TagPrefix="uc4" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="AJAXControls" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        var onAjaxPostBack = false;
        function UpdatePanel_BeginRequest( sender, args )
        {
            onAjaxPostBack = true;
        }
        
        function UpdatePanel_PageLoaded( sender, args )
        {
            if( validationRuleSet && onAjaxPostBack )
            {
                validationRuleSet.ReSubscribe();
            }
            onAjaxPostBack = false;
        }
       
        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest( UpdatePanel_BeginRequest );
        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded( UpdatePanel_PageLoaded );

    </script>
</div>
    <div class="PageContent">
        <table width="100%">
            <tr>
                <td style="width:67%;vertical-align:top;">
                    <div>
                        <table cellpadding="0" cellspacing="0" border="0" width="100%">
                            <tr>
                                <td>
                                    <uc1:ServiceMemberDetailView ID="ucServiceMemberDetailView" runat="server" />
                                    <uc2:ServiceMemberEditView ID="ucServiceMemberEditView" runat="server" Visible="false" />            
                                </td>
                                <td style="vertical-align:top;padding-top:10px;padding-right:5px">
                                    <div class="ServiceMemberNavigation" style="vertical-align:top;">
                                        <asp:Button ID="cmdEdit" runat="server"  OnClick="cmdEdit_Click" Text="Edit" />
                                        
                                    </div>
                                </td>
                            </tr>
                            <tr>
                              <td colspan=2 style="vertical-align:top;padding-top:20px; padding-left:20px">   
                                <asp:Button ID="cmdSave" runat="server"  OnClick="cmdSave_Click" Text="Save" Visible="false" />
                                &nbsp;&nbsp; <asp:Button ID="cmdCancel" runat="server" CausesValidation="false" OnClick="cmdCancel_Click" Text="Cancel" Visible="false" />
                              </td>
                            </tr>
                        </table>
                                               
                        <uc3:NewNoteView ID="ucNewNoteView" runat="server" />
                        <uc4:NoteListView ID="ucNoteListView" runat="server" />
                    </div>
                </td>
                <td style="width:1%">
                </td>
                <td class="VerticalPanel" style="width:32%;vertical-align:top;">
                    <div id="CasesSummaryView">
                        <asp:Panel ID="CasesHeader" runat="server">
                            <div style="float: left; vertical-align: middle">
                                Cases 
                            </div>
                            <div style="float: right; vertical-align: middle">
                                <asp:Label ID="lblToggleCases" runat="server">(Hide Details...)</asp:Label>
                                <asp:ImageButton ID="cmdCasePanel" runat="server" ImageUrl="~/App_Themes/IMSFF/Images/collapse.jpg" />
                            </div>
                        </asp:Panel>
                        <div style="width:100%">
                            <asp:Panel ID="CasesBody" runat="server">                            
                                <uc5:CaseSummaryView ID="ucCaseSummaryView" runat="server" />
                            </asp:Panel>
                        </div>
                        <AJAXControls:CollapsiblePanelExtender 
                            ID="CasesPanel" 
                            RunAt="server" 
                            TextLabelID="lblToggleCases"
                            ImageControlID="cmdCasesPanel" 
                            TargetControlID="CasesBody"
                            CollapseControlID="CasesHeader"
                            ExpandControlID="CasesHeader" >
                        </AJAXControls:CollapsiblePanelExtender>                        
                    </div>
                    <br />
                    <div id="GrantsSummaryView" style="width: 100%">
                        <asp:Panel ID="GrantsHeader" runat="server">
                            <div style="float: left; vertical-align: middle">
                                Grants
                            </div>
                            <div style="float: right; vertical-align: middle">
                                <asp:Label ID="lblToggleGrants" runat="server">(Hide Details...)</asp:Label>
                                <asp:ImageButton ID="cmdGrantPanel" runat="server" ImageUrl="~/App_Themes/IMSFF/Images/collapse.jpg" />
                            </div>
                        </asp:Panel>
                        <div style="width:100%">
                            <asp:Panel ID="GrantsBody" runat="server">
                                <uc6:GrantSummaryView ID="ucGrantSummaryView" runat="server" />                                
                            </asp:Panel>
                        </div>
                        <AJAXControls:CollapsiblePanelExtender 
                            ID="GrantsPanel"
                            RunAt="server" 
                            TextLabelID="lblToggleGrants"
                            ImageControlID="cmdGrantPanel" 
                            TargetControlID="GrantsBody" 
                            CollapseControlID="GrantsHeader"
                            ExpandControlID="GrantsHeader" >
                        </AJAXControls:CollapsiblePanelExtender>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <cc1:PageValidator ID="PageValidator1" runat="server" PostbackControl="cmdSave" />
</asp:Content>
